#对应自己的go版本， -alpine：指代镜像比较小
FROM golang:1.20-alpine

#为我们的镜像设置必要的环境变量
ENV GO111MODULE=on \
    GOPROXY=https://goproxy.cn,direct \
    CGO_ENABLED=0 \
    GOOS=linux \
    GOARCH=amd64

ENV TZ=Asia/Shanghai

WORKDIR /apps/konglu-pay/

COPY go.* ./

RUN go mod download
COPY . .
RUN go build -o /apps/konglu-pay/build/myapp .

EXPOSE 8090

ENTRYPOINT ["/apps/konglu-pay/build/myapp"]